package cn.stylefeng.guns.modular.business.frequency.orderpick.service;

import cn.stylefeng.guns.core.pojo.page.PageResult;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.modular.business.frequency.ordercarverify.entity.OrderCarVerify;
import cn.stylefeng.guns.modular.business.frequency.orderpick.entity.OrderPick;
import cn.stylefeng.guns.modular.business.frequency.orderpick.model.param.OrderPickParam;
import cn.stylefeng.guns.modular.business.frequency.orderpick.model.param.PickCarExcludeDTO;
import cn.stylefeng.guns.modular.business.frequency.orderpick.model.param.PickDTO;
import cn.stylefeng.guns.modular.business.frequency.orderpick.model.param.PickRecordContractVO;
import cn.stylefeng.guns.modular.business.frequency.orderpick.model.result.PkgOrderPick;
import cn.stylefeng.guns.modular.business.frequency.ordersub.model.result.PkgPick;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 提车记录表 服务类
 *
 * @author yujie
 * @date 2023/05/09 17:16
 */
public interface OrderPickService extends IService<OrderPick> {

    /**
     * 分页查询提车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    PageResult<OrderPick> page(OrderPickParam orderPickParam);

    /**
     * 查询所有提车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    List<OrderPick> list(OrderPickParam orderPickParam);

    /**
     * 添加提车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void add(OrderPickParam orderPickParam);

    /**
     * 删除提车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void delete(OrderPickParam orderPickParam);

    /**
     * 编辑提车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void edit(OrderPickParam orderPickParam);

    /**
     * 查看详情提车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    OrderPick detail(OrderPickParam orderPickParam);

    ResponseData getWxWaitPickOrderListPage(PickDTO orderDTO);

    Page<PkgOrderPick> getWaitDealOrderList(PickDTO orderDTO);

    PkgOrderPick getWaitDealOrderDetailList(PickDTO orderDTO);

    Map<String, List<String>> getStartCodeAndDestinationCode(PickDTO orderDTO);


    /**已完成提车列表*/
    Page<PkgOrderPick> getFinishOrderList(PickDTO orderDTO);

    /**查询提车记录信息*/
    PkgOrderPick billOfLadingGeneration(PickRecordContractVO orderDTO);

    /** 添加待提车弹框筛选  */
    List<PkgOrderPick> getWaitPickExcludeList(PickCarExcludeDTO pickCarExcludeDTO);

    /** 校验批量指派提车 */
    boolean checkMultiAssign(OrderPick orderPick, StringBuilder errorMsg);

    /** 批量指派提车 */
    void multiAssign(OrderPick orderPick);

    /** 提车信息详情 根据 orderId*/
    PkgPick getPickCarDetail(Long orderId);

    boolean checkAssignUpdate(OrderPick orderPick, StringBuilder errorMsg);

    void updateAssign(OrderPick orderPick);

    OrderCarVerify getOrderCarVerifyByOrderId(Long orderId);

    boolean checkPickFree(Long orderId, StringBuilder errorMsg);

    void orderPickFree(Long orderId);

    void pickCarStock(Long orderId);

    boolean checkMultiPickFree(Long[] orderIds, StringBuilder errorMsg);

    Map<String, String> getSettlementInfo(Long settlementId, String settlementName, String settlementPhone, Integer settlementType, Long aLong, Integer i);

    void returnMultiAssign(Long orderId);
}